﻿@{
    ViewBag.Title = "Main";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div class="row">
@if (Helper.GetCookie("mode") == "edit" && Request.IsAuthenticated)
{
<a href="/home/changemode"><div class="btn btn-info" >View Mode</div></a>

}
else if (Request.IsAuthenticated)
{
    <a href="/home/changemode?mode=edit"><div class="btn btn-info">Edit Mode</div></a>
}

@if (Helper.GetCookie("mode") == "edit" && Request.IsAuthenticated)
{
    

    @Ajax.ActionLink("Create New Category", "EditPopUp", "Category",
        new { id = Guid.Empty },
                          new AjaxOptions() { HttpMethod = "Get", InsertionMode = InsertionMode.Replace, UpdateTargetId = "btn_CreatNew" })


    @Ajax.ActionLink("Create New Website", "EditPopUp", "Website",
        new { id = Guid.Empty },
                 new AjaxOptions() { HttpMethod = "Get", InsertionMode = InsertionMode.Replace, UpdateTargetId = "btn_CreatNew" })
    <div id="btn_CreatNew" class="editBox"></div>
}
</div>

<div class="row" id="displayAllCategories">

    @{Html.RenderAction("DisplayAllCategoriesPartial", "Category");}
</div>